package com.thoughtworks.oo.quantity;

class Delimiter {
    public static final Delimiter UNIT_DELIMITER = new Delimiter(false);

    private static final String SINGLE_SPACE = " ";
    private static final String EMPTY = "";

    private boolean firstTime;

    Delimiter() {
        this(true);
    }

    Delimiter(boolean firstTime) {
        this.firstTime = firstTime;
    }

    @Override
    public String toString() {
        if (!firstTime) {
            return SINGLE_SPACE;
        }
        firstTime = false;
        return EMPTY;
    }
}
